package com.coolwen.spring.base;

import com.sun.org.apache.xerces.internal.dom.PSVIDocumentImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author CoolWen
 * @version 2020-03-05 9:01
 */
@Configuration
public class HelloSpringConfig {
    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(HelloSpringConfig.class);
        String hello = ctx.getBean("hello", String.class);
        System.out.println(hello);
    }

    @Bean("hello")
    public String getHello(){
        return "hello coolwen";
    }
}
